{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "e981a9cc-222b-48e0-83f1-74bbc11eb2d1",
   "metadata": {},
   "source": [
    "# Benchmarking the new Pandas PyArrow Backend"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "d778165c-31ea-40aa-b7fb-f38a60d2c5fb",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "numpy : 1.23.5\n",
      "pandas: 2.0.0rc0\n",
      "polars: 0.16.10\n",
      "\n"
     ]
    }
   ],
   "source": [
    "%load_ext watermark\n",
    "%watermark -p numpy,pandas,polars"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2dcdc03d-6d30-44d9-ba5f-a6a46960488e",
   "metadata": {},
   "source": [
    "You can install the Pandas 2.0 release candidate via \n",
    "\n",
    "\n",
    "```bash\n",
    "conda install -c conda-forge/label/pandas_rc pandas==2.0.0rc0\n",
    "\n",
    "pip install --upgrade --pre pandas==2.0.0rc0\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2497ad20-4553-441d-99c1-b841f7de9e88",
   "metadata": {},
   "source": [
    "# 1) Float "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7fc4a76f-755b-4c3f-a450-8532d86afe56",
   "metadata": {},
   "source": [
    "### PyArrow"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "65d3c232-36e1-4d79-9535-434315dc6d79",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "      <th>6</th>\n",
       "      <th>7</th>\n",
       "      <th>8</th>\n",
       "      <th>9</th>\n",
       "      <th>...</th>\n",
       "      <th>90</th>\n",
       "      <th>91</th>\n",
       "      <th>92</th>\n",
       "      <th>93</th>\n",
       "      <th>94</th>\n",
       "      <th>95</th>\n",
       "      <th>96</th>\n",
       "      <th>97</th>\n",
       "      <th>98</th>\n",
       "      <th>99</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.739789</td>\n",
       "      <td>0.171243</td>\n",
       "      <td>0.779560</td>\n",
       "      <td>0.453279</td>\n",
       "      <td>0.316272</td>\n",
       "      <td>0.202055</td>\n",
       "      <td>0.701529</td>\n",
       "      <td>0.223398</td>\n",
       "      <td>0.180779</td>\n",
       "      <td>0.361951</td>\n",
       "      <td>...</td>\n",
       "      <td>0.030731</td>\n",
       "      <td>0.012013</td>\n",
       "      <td>0.758276</td>\n",
       "      <td>0.347108</td>\n",
       "      <td>0.152085</td>\n",
       "      <td>0.914769</td>\n",
       "      <td>0.485596</td>\n",
       "      <td>0.196424</td>\n",
       "      <td>0.558316</td>\n",
       "      <td>0.036644</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.188237</td>\n",
       "      <td>0.364673</td>\n",
       "      <td>0.708197</td>\n",
       "      <td>0.003689</td>\n",
       "      <td>0.869673</td>\n",
       "      <td>0.993840</td>\n",
       "      <td>0.408806</td>\n",
       "      <td>0.738370</td>\n",
       "      <td>0.509626</td>\n",
       "      <td>0.516874</td>\n",
       "      <td>...</td>\n",
       "      <td>0.784797</td>\n",
       "      <td>0.437274</td>\n",
       "      <td>0.004180</td>\n",
       "      <td>0.281059</td>\n",
       "      <td>0.209215</td>\n",
       "      <td>0.581456</td>\n",
       "      <td>0.034112</td>\n",
       "      <td>0.567413</td>\n",
       "      <td>0.883934</td>\n",
       "      <td>0.419370</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.387432</td>\n",
       "      <td>0.542618</td>\n",
       "      <td>0.385627</td>\n",
       "      <td>0.165912</td>\n",
       "      <td>0.675967</td>\n",
       "      <td>0.496472</td>\n",
       "      <td>0.232236</td>\n",
       "      <td>0.759717</td>\n",
       "      <td>0.075509</td>\n",
       "      <td>0.060214</td>\n",
       "      <td>...</td>\n",
       "      <td>0.097261</td>\n",
       "      <td>0.680323</td>\n",
       "      <td>0.554496</td>\n",
       "      <td>0.107696</td>\n",
       "      <td>0.711632</td>\n",
       "      <td>0.346951</td>\n",
       "      <td>0.744994</td>\n",
       "      <td>0.662483</td>\n",
       "      <td>0.150556</td>\n",
       "      <td>0.776504</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.190370</td>\n",
       "      <td>0.856863</td>\n",
       "      <td>0.553109</td>\n",
       "      <td>0.461054</td>\n",
       "      <td>0.568778</td>\n",
       "      <td>0.187617</td>\n",
       "      <td>0.384497</td>\n",
       "      <td>0.648418</td>\n",
       "      <td>0.560689</td>\n",
       "      <td>0.211983</td>\n",
       "      <td>...</td>\n",
       "      <td>0.967316</td>\n",
       "      <td>0.576226</td>\n",
       "      <td>0.671552</td>\n",
       "      <td>0.382588</td>\n",
       "      <td>0.209125</td>\n",
       "      <td>0.873574</td>\n",
       "      <td>0.289106</td>\n",
       "      <td>0.868413</td>\n",
       "      <td>0.225736</td>\n",
       "      <td>0.269728</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.685521</td>\n",
       "      <td>0.300789</td>\n",
       "      <td>0.751959</td>\n",
       "      <td>0.415466</td>\n",
       "      <td>0.670178</td>\n",
       "      <td>0.405571</td>\n",
       "      <td>0.772665</td>\n",
       "      <td>0.705782</td>\n",
       "      <td>0.755357</td>\n",
       "      <td>0.000820</td>\n",
       "      <td>...</td>\n",
       "      <td>0.978006</td>\n",
       "      <td>0.052614</td>\n",
       "      <td>0.529440</td>\n",
       "      <td>0.267572</td>\n",
       "      <td>0.396589</td>\n",
       "      <td>0.195685</td>\n",
       "      <td>0.323305</td>\n",
       "      <td>0.160982</td>\n",
       "      <td>0.977584</td>\n",
       "      <td>0.781165</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 100 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "         0         1         2         3         4         5         6    \n",
       "0  0.739789  0.171243  0.779560  0.453279  0.316272  0.202055  0.701529  \\\n",
       "1  0.188237  0.364673  0.708197  0.003689  0.869673  0.993840  0.408806   \n",
       "2  0.387432  0.542618  0.385627  0.165912  0.675967  0.496472  0.232236   \n",
       "3  0.190370  0.856863  0.553109  0.461054  0.568778  0.187617  0.384497   \n",
       "4  0.685521  0.300789  0.751959  0.415466  0.670178  0.405571  0.772665   \n",
       "\n",
       "         7         8         9   ...        90        91        92        93   \n",
       "0  0.223398  0.180779  0.361951  ...  0.030731  0.012013  0.758276  0.347108  \\\n",
       "1  0.738370  0.509626  0.516874  ...  0.784797  0.437274  0.004180  0.281059   \n",
       "2  0.759717  0.075509  0.060214  ...  0.097261  0.680323  0.554496  0.107696   \n",
       "3  0.648418  0.560689  0.211983  ...  0.967316  0.576226  0.671552  0.382588   \n",
       "4  0.705782  0.755357  0.000820  ...  0.978006  0.052614  0.529440  0.267572   \n",
       "\n",
       "         94        95        96        97        98        99  \n",
       "0  0.152085  0.914769  0.485596  0.196424  0.558316  0.036644  \n",
       "1  0.209215  0.581456  0.034112  0.567413  0.883934  0.419370  \n",
       "2  0.711632  0.346951  0.744994  0.662483  0.150556  0.776504  \n",
       "3  0.209125  0.873574  0.289106  0.868413  0.225736  0.269728  \n",
       "4  0.396589  0.195685  0.323305  0.160982  0.977584  0.781165  \n",
       "\n",
       "[5 rows x 100 columns]"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import pyarrow as pa\n",
    "\n",
    "numbers = np.random.rand(1_000_000, 100)\n",
    "\n",
    "df_pa = pd.DataFrame(numbers, dtype=\"float64[pyarrow]\")\n",
    "df_pa.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "034ed996-c090-4e56-a8a0-8646105a6a69",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "25.4 ms ± 5.37 ms per loop (mean ± std. dev. of 30 runs, 1 loop each)\n"
     ]
    }
   ],
   "source": [
    "%timeit -r 30 -n 1 df_pa.mean()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "82cdd2d1-f5e9-4b22-ad2f-5a2f50aa60fc",
   "metadata": {},
   "source": [
    "### Polars"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "46170772-ec8e-41c5-8986-52df0a2f736a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       ".pl-dataframe > thead > tr > th {\n",
       "  text-align: right;\n",
       "}\n",
       "</style>\n",
       "\n",
       "<table border=\"1\" class=\"dataframe pl-dataframe\">\n",
       "<small>shape: (5, 100)</small>\n",
       "<thead>\n",
       "<tr>\n",
       "<th>\n",
       "0\n",
       "</th>\n",
       "<th>\n",
       "1\n",
       "</th>\n",
       "<th>\n",
       "2\n",
       "</th>\n",
       "<th>\n",
       "3\n",
       "</th>\n",
       "<th>\n",
       "4\n",
       "</th>\n",
       "<th>\n",
       "5\n",
       "</th>\n",
       "<th>\n",
       "6\n",
       "</th>\n",
       "<th>\n",
       "7\n",
       "</th>\n",
       "<th>\n",
       "8\n",
       "</th>\n",
       "<th>\n",
       "9\n",
       "</th>\n",
       "<th>\n",
       "10\n",
       "</th>\n",
       "<th>\n",
       "11\n",
       "</th>\n",
       "<th>\n",
       "12\n",
       "</th>\n",
       "<th>\n",
       "13\n",
       "</th>\n",
       "<th>\n",
       "14\n",
       "</th>\n",
       "<th>\n",
       "15\n",
       "</th>\n",
       "<th>\n",
       "16\n",
       "</th>\n",
       "<th>\n",
       "17\n",
       "</th>\n",
       "<th>\n",
       "18\n",
       "</th>\n",
       "<th>\n",
       "19\n",
       "</th>\n",
       "<th>\n",
       "20\n",
       "</th>\n",
       "<th>\n",
       "21\n",
       "</th>\n",
       "<th>\n",
       "22\n",
       "</th>\n",
       "<th>\n",
       "23\n",
       "</th>\n",
       "<th>\n",
       "24\n",
       "</th>\n",
       "<th>\n",
       "25\n",
       "</th>\n",
       "<th>\n",
       "26\n",
       "</th>\n",
       "<th>\n",
       "27\n",
       "</th>\n",
       "<th>\n",
       "28\n",
       "</th>\n",
       "<th>\n",
       "29\n",
       "</th>\n",
       "<th>\n",
       "30\n",
       "</th>\n",
       "<th>\n",
       "31\n",
       "</th>\n",
       "<th>\n",
       "32\n",
       "</th>\n",
       "<th>\n",
       "33\n",
       "</th>\n",
       "<th>\n",
       "34\n",
       "</th>\n",
       "<th>\n",
       "35\n",
       "</th>\n",
       "<th>\n",
       "36\n",
       "</th>\n",
       "<th>\n",
       "...\n",
       "</th>\n",
       "<th>\n",
       "63\n",
       "</th>\n",
       "<th>\n",
       "64\n",
       "</th>\n",
       "<th>\n",
       "65\n",
       "</th>\n",
       "<th>\n",
       "66\n",
       "</th>\n",
       "<th>\n",
       "67\n",
       "</th>\n",
       "<th>\n",
       "68\n",
       "</th>\n",
       "<th>\n",
       "69\n",
       "</th>\n",
       "<th>\n",
       "70\n",
       "</th>\n",
       "<th>\n",
       "71\n",
       "</th>\n",
       "<th>\n",
       "72\n",
       "</th>\n",
       "<th>\n",
       "73\n",
       "</th>\n",
       "<th>\n",
       "74\n",
       "</th>\n",
       "<th>\n",
       "75\n",
       "</th>\n",
       "<th>\n",
       "76\n",
       "</th>\n",
       "<th>\n",
       "77\n",
       "</th>\n",
       "<th>\n",
       "78\n",
       "</th>\n",
       "<th>\n",
       "79\n",
       "</th>\n",
       "<th>\n",
       "80\n",
       "</th>\n",
       "<th>\n",
       "81\n",
       "</th>\n",
       "<th>\n",
       "82\n",
       "</th>\n",
       "<th>\n",
       "83\n",
       "</th>\n",
       "<th>\n",
       "84\n",
       "</th>\n",
       "<th>\n",
       "85\n",
       "</th>\n",
       "<th>\n",
       "86\n",
       "</th>\n",
       "<th>\n",
       "87\n",
       "</th>\n",
       "<th>\n",
       "88\n",
       "</th>\n",
       "<th>\n",
       "89\n",
       "</th>\n",
       "<th>\n",
       "90\n",
       "</th>\n",
       "<th>\n",
       "91\n",
       "</th>\n",
       "<th>\n",
       "92\n",
       "</th>\n",
       "<th>\n",
       "93\n",
       "</th>\n",
       "<th>\n",
       "94\n",
       "</th>\n",
       "<th>\n",
       "95\n",
       "</th>\n",
       "<th>\n",
       "96\n",
       "</th>\n",
       "<th>\n",
       "97\n",
       "</th>\n",
       "<th>\n",
       "98\n",
       "</th>\n",
       "<th>\n",
       "99\n",
       "</th>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "...\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "</tr>\n",
       "</thead>\n",
       "<tbody>\n",
       "<tr>\n",
       "<td>\n",
       "0.739789\n",
       "</td>\n",
       "<td>\n",
       "0.171243\n",
       "</td>\n",
       "<td>\n",
       "0.77956\n",
       "</td>\n",
       "<td>\n",
       "0.453279\n",
       "</td>\n",
       "<td>\n",
       "0.316272\n",
       "</td>\n",
       "<td>\n",
       "0.202055\n",
       "</td>\n",
       "<td>\n",
       "0.701529\n",
       "</td>\n",
       "<td>\n",
       "0.223398\n",
       "</td>\n",
       "<td>\n",
       "0.180779\n",
       "</td>\n",
       "<td>\n",
       "0.361951\n",
       "</td>\n",
       "<td>\n",
       "0.551334\n",
       "</td>\n",
       "<td>\n",
       "0.387156\n",
       "</td>\n",
       "<td>\n",
       "0.221788\n",
       "</td>\n",
       "<td>\n",
       "0.074998\n",
       "</td>\n",
       "<td>\n",
       "0.277764\n",
       "</td>\n",
       "<td>\n",
       "0.039131\n",
       "</td>\n",
       "<td>\n",
       "0.625279\n",
       "</td>\n",
       "<td>\n",
       "0.988637\n",
       "</td>\n",
       "<td>\n",
       "0.709296\n",
       "</td>\n",
       "<td>\n",
       "0.643103\n",
       "</td>\n",
       "<td>\n",
       "0.657713\n",
       "</td>\n",
       "<td>\n",
       "0.171454\n",
       "</td>\n",
       "<td>\n",
       "0.855669\n",
       "</td>\n",
       "<td>\n",
       "0.997973\n",
       "</td>\n",
       "<td>\n",
       "0.953301\n",
       "</td>\n",
       "<td>\n",
       "0.953758\n",
       "</td>\n",
       "<td>\n",
       "0.663223\n",
       "</td>\n",
       "<td>\n",
       "0.397593\n",
       "</td>\n",
       "<td>\n",
       "0.966815\n",
       "</td>\n",
       "<td>\n",
       "0.292429\n",
       "</td>\n",
       "<td>\n",
       "0.4586\n",
       "</td>\n",
       "<td>\n",
       "0.732552\n",
       "</td>\n",
       "<td>\n",
       "0.87994\n",
       "</td>\n",
       "<td>\n",
       "0.494767\n",
       "</td>\n",
       "<td>\n",
       "0.699149\n",
       "</td>\n",
       "<td>\n",
       "0.654407\n",
       "</td>\n",
       "<td>\n",
       "0.497486\n",
       "</td>\n",
       "<td>\n",
       "...\n",
       "</td>\n",
       "<td>\n",
       "0.886984\n",
       "</td>\n",
       "<td>\n",
       "0.032967\n",
       "</td>\n",
       "<td>\n",
       "0.088698\n",
       "</td>\n",
       "<td>\n",
       "0.503685\n",
       "</td>\n",
       "<td>\n",
       "0.84004\n",
       "</td>\n",
       "<td>\n",
       "0.729495\n",
       "</td>\n",
       "<td>\n",
       "0.960647\n",
       "</td>\n",
       "<td>\n",
       "0.185206\n",
       "</td>\n",
       "<td>\n",
       "0.233505\n",
       "</td>\n",
       "<td>\n",
       "0.247867\n",
       "</td>\n",
       "<td>\n",
       "0.240035\n",
       "</td>\n",
       "<td>\n",
       "0.624804\n",
       "</td>\n",
       "<td>\n",
       "0.906294\n",
       "</td>\n",
       "<td>\n",
       "0.88794\n",
       "</td>\n",
       "<td>\n",
       "0.306743\n",
       "</td>\n",
       "<td>\n",
       "0.970122\n",
       "</td>\n",
       "<td>\n",
       "0.134148\n",
       "</td>\n",
       "<td>\n",
       "0.087597\n",
       "</td>\n",
       "<td>\n",
       "0.409002\n",
       "</td>\n",
       "<td>\n",
       "0.716249\n",
       "</td>\n",
       "<td>\n",
       "0.425359\n",
       "</td>\n",
       "<td>\n",
       "0.950504\n",
       "</td>\n",
       "<td>\n",
       "0.776859\n",
       "</td>\n",
       "<td>\n",
       "0.471383\n",
       "</td>\n",
       "<td>\n",
       "0.911685\n",
       "</td>\n",
       "<td>\n",
       "0.530392\n",
       "</td>\n",
       "<td>\n",
       "0.098582\n",
       "</td>\n",
       "<td>\n",
       "0.030731\n",
       "</td>\n",
       "<td>\n",
       "0.012013\n",
       "</td>\n",
       "<td>\n",
       "0.758276\n",
       "</td>\n",
       "<td>\n",
       "0.347108\n",
       "</td>\n",
       "<td>\n",
       "0.152085\n",
       "</td>\n",
       "<td>\n",
       "0.914769\n",
       "</td>\n",
       "<td>\n",
       "0.485596\n",
       "</td>\n",
       "<td>\n",
       "0.196424\n",
       "</td>\n",
       "<td>\n",
       "0.558316\n",
       "</td>\n",
       "<td>\n",
       "0.036644\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "0.188237\n",
       "</td>\n",
       "<td>\n",
       "0.364673\n",
       "</td>\n",
       "<td>\n",
       "0.708197\n",
       "</td>\n",
       "<td>\n",
       "0.003689\n",
       "</td>\n",
       "<td>\n",
       "0.869673\n",
       "</td>\n",
       "<td>\n",
       "0.99384\n",
       "</td>\n",
       "<td>\n",
       "0.408806\n",
       "</td>\n",
       "<td>\n",
       "0.73837\n",
       "</td>\n",
       "<td>\n",
       "0.509626\n",
       "</td>\n",
       "<td>\n",
       "0.516874\n",
       "</td>\n",
       "<td>\n",
       "0.500183\n",
       "</td>\n",
       "<td>\n",
       "0.474612\n",
       "</td>\n",
       "<td>\n",
       "0.779803\n",
       "</td>\n",
       "<td>\n",
       "0.326324\n",
       "</td>\n",
       "<td>\n",
       "0.107263\n",
       "</td>\n",
       "<td>\n",
       "0.557989\n",
       "</td>\n",
       "<td>\n",
       "0.70311\n",
       "</td>\n",
       "<td>\n",
       "0.851079\n",
       "</td>\n",
       "<td>\n",
       "0.619356\n",
       "</td>\n",
       "<td>\n",
       "0.37407\n",
       "</td>\n",
       "<td>\n",
       "0.681312\n",
       "</td>\n",
       "<td>\n",
       "0.147267\n",
       "</td>\n",
       "<td>\n",
       "0.068138\n",
       "</td>\n",
       "<td>\n",
       "0.085389\n",
       "</td>\n",
       "<td>\n",
       "0.603855\n",
       "</td>\n",
       "<td>\n",
       "0.008732\n",
       "</td>\n",
       "<td>\n",
       "0.065126\n",
       "</td>\n",
       "<td>\n",
       "0.569115\n",
       "</td>\n",
       "<td>\n",
       "0.917873\n",
       "</td>\n",
       "<td>\n",
       "0.060423\n",
       "</td>\n",
       "<td>\n",
       "0.722972\n",
       "</td>\n",
       "<td>\n",
       "0.126521\n",
       "</td>\n",
       "<td>\n",
       "0.22078\n",
       "</td>\n",
       "<td>\n",
       "0.26409\n",
       "</td>\n",
       "<td>\n",
       "0.868152\n",
       "</td>\n",
       "<td>\n",
       "0.337481\n",
       "</td>\n",
       "<td>\n",
       "0.429603\n",
       "</td>\n",
       "<td>\n",
       "...\n",
       "</td>\n",
       "<td>\n",
       "0.066624\n",
       "</td>\n",
       "<td>\n",
       "0.420628\n",
       "</td>\n",
       "<td>\n",
       "0.173113\n",
       "</td>\n",
       "<td>\n",
       "0.400634\n",
       "</td>\n",
       "<td>\n",
       "0.574797\n",
       "</td>\n",
       "<td>\n",
       "0.833651\n",
       "</td>\n",
       "<td>\n",
       "0.206654\n",
       "</td>\n",
       "<td>\n",
       "0.486913\n",
       "</td>\n",
       "<td>\n",
       "0.027891\n",
       "</td>\n",
       "<td>\n",
       "0.318097\n",
       "</td>\n",
       "<td>\n",
       "0.176941\n",
       "</td>\n",
       "<td>\n",
       "0.50806\n",
       "</td>\n",
       "<td>\n",
       "0.483328\n",
       "</td>\n",
       "<td>\n",
       "0.952277\n",
       "</td>\n",
       "<td>\n",
       "0.136796\n",
       "</td>\n",
       "<td>\n",
       "0.556167\n",
       "</td>\n",
       "<td>\n",
       "0.665925\n",
       "</td>\n",
       "<td>\n",
       "0.66638\n",
       "</td>\n",
       "<td>\n",
       "0.225327\n",
       "</td>\n",
       "<td>\n",
       "0.56068\n",
       "</td>\n",
       "<td>\n",
       "0.424299\n",
       "</td>\n",
       "<td>\n",
       "0.117952\n",
       "</td>\n",
       "<td>\n",
       "0.817975\n",
       "</td>\n",
       "<td>\n",
       "0.98181\n",
       "</td>\n",
       "<td>\n",
       "0.861922\n",
       "</td>\n",
       "<td>\n",
       "0.479305\n",
       "</td>\n",
       "<td>\n",
       "0.556877\n",
       "</td>\n",
       "<td>\n",
       "0.784797\n",
       "</td>\n",
       "<td>\n",
       "0.437274\n",
       "</td>\n",
       "<td>\n",
       "0.00418\n",
       "</td>\n",
       "<td>\n",
       "0.281059\n",
       "</td>\n",
       "<td>\n",
       "0.209215\n",
       "</td>\n",
       "<td>\n",
       "0.581456\n",
       "</td>\n",
       "<td>\n",
       "0.034112\n",
       "</td>\n",
       "<td>\n",
       "0.567413\n",
       "</td>\n",
       "<td>\n",
       "0.883934\n",
       "</td>\n",
       "<td>\n",
       "0.41937\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "0.387432\n",
       "</td>\n",
       "<td>\n",
       "0.542618\n",
       "</td>\n",
       "<td>\n",
       "0.385627\n",
       "</td>\n",
       "<td>\n",
       "0.165912\n",
       "</td>\n",
       "<td>\n",
       "0.675967\n",
       "</td>\n",
       "<td>\n",
       "0.496472\n",
       "</td>\n",
       "<td>\n",
       "0.232236\n",
       "</td>\n",
       "<td>\n",
       "0.759717\n",
       "</td>\n",
       "<td>\n",
       "0.075509\n",
       "</td>\n",
       "<td>\n",
       "0.060214\n",
       "</td>\n",
       "<td>\n",
       "0.871908\n",
       "</td>\n",
       "<td>\n",
       "0.830904\n",
       "</td>\n",
       "<td>\n",
       "0.76113\n",
       "</td>\n",
       "<td>\n",
       "0.833074\n",
       "</td>\n",
       "<td>\n",
       "0.593831\n",
       "</td>\n",
       "<td>\n",
       "0.613885\n",
       "</td>\n",
       "<td>\n",
       "0.910025\n",
       "</td>\n",
       "<td>\n",
       "0.49179\n",
       "</td>\n",
       "<td>\n",
       "0.899138\n",
       "</td>\n",
       "<td>\n",
       "0.767953\n",
       "</td>\n",
       "<td>\n",
       "0.85621\n",
       "</td>\n",
       "<td>\n",
       "0.589193\n",
       "</td>\n",
       "<td>\n",
       "0.845345\n",
       "</td>\n",
       "<td>\n",
       "0.227758\n",
       "</td>\n",
       "<td>\n",
       "0.3273\n",
       "</td>\n",
       "<td>\n",
       "0.011847\n",
       "</td>\n",
       "<td>\n",
       "0.696758\n",
       "</td>\n",
       "<td>\n",
       "0.770045\n",
       "</td>\n",
       "<td>\n",
       "0.067501\n",
       "</td>\n",
       "<td>\n",
       "0.558609\n",
       "</td>\n",
       "<td>\n",
       "0.83442\n",
       "</td>\n",
       "<td>\n",
       "0.428581\n",
       "</td>\n",
       "<td>\n",
       "0.141987\n",
       "</td>\n",
       "<td>\n",
       "0.032758\n",
       "</td>\n",
       "<td>\n",
       "0.896121\n",
       "</td>\n",
       "<td>\n",
       "0.651265\n",
       "</td>\n",
       "<td>\n",
       "0.089106\n",
       "</td>\n",
       "<td>\n",
       "...\n",
       "</td>\n",
       "<td>\n",
       "0.52693\n",
       "</td>\n",
       "<td>\n",
       "0.306121\n",
       "</td>\n",
       "<td>\n",
       "0.494742\n",
       "</td>\n",
       "<td>\n",
       "0.691013\n",
       "</td>\n",
       "<td>\n",
       "0.899266\n",
       "</td>\n",
       "<td>\n",
       "0.941592\n",
       "</td>\n",
       "<td>\n",
       "0.412065\n",
       "</td>\n",
       "<td>\n",
       "0.368851\n",
       "</td>\n",
       "<td>\n",
       "0.225886\n",
       "</td>\n",
       "<td>\n",
       "0.285843\n",
       "</td>\n",
       "<td>\n",
       "0.084886\n",
       "</td>\n",
       "<td>\n",
       "0.952567\n",
       "</td>\n",
       "<td>\n",
       "0.681991\n",
       "</td>\n",
       "<td>\n",
       "0.378658\n",
       "</td>\n",
       "<td>\n",
       "0.640901\n",
       "</td>\n",
       "<td>\n",
       "0.389181\n",
       "</td>\n",
       "<td>\n",
       "0.46891\n",
       "</td>\n",
       "<td>\n",
       "0.115059\n",
       "</td>\n",
       "<td>\n",
       "0.441754\n",
       "</td>\n",
       "<td>\n",
       "0.906279\n",
       "</td>\n",
       "<td>\n",
       "0.279367\n",
       "</td>\n",
       "<td>\n",
       "0.170382\n",
       "</td>\n",
       "<td>\n",
       "0.510947\n",
       "</td>\n",
       "<td>\n",
       "0.678537\n",
       "</td>\n",
       "<td>\n",
       "0.928045\n",
       "</td>\n",
       "<td>\n",
       "0.531335\n",
       "</td>\n",
       "<td>\n",
       "0.590408\n",
       "</td>\n",
       "<td>\n",
       "0.097261\n",
       "</td>\n",
       "<td>\n",
       "0.680323\n",
       "</td>\n",
       "<td>\n",
       "0.554496\n",
       "</td>\n",
       "<td>\n",
       "0.107696\n",
       "</td>\n",
       "<td>\n",
       "0.711632\n",
       "</td>\n",
       "<td>\n",
       "0.346951\n",
       "</td>\n",
       "<td>\n",
       "0.744994\n",
       "</td>\n",
       "<td>\n",
       "0.662483\n",
       "</td>\n",
       "<td>\n",
       "0.150556\n",
       "</td>\n",
       "<td>\n",
       "0.776504\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "0.19037\n",
       "</td>\n",
       "<td>\n",
       "0.856863\n",
       "</td>\n",
       "<td>\n",
       "0.553109\n",
       "</td>\n",
       "<td>\n",
       "0.461054\n",
       "</td>\n",
       "<td>\n",
       "0.568778\n",
       "</td>\n",
       "<td>\n",
       "0.187617\n",
       "</td>\n",
       "<td>\n",
       "0.384497\n",
       "</td>\n",
       "<td>\n",
       "0.648418\n",
       "</td>\n",
       "<td>\n",
       "0.560689\n",
       "</td>\n",
       "<td>\n",
       "0.211983\n",
       "</td>\n",
       "<td>\n",
       "0.877886\n",
       "</td>\n",
       "<td>\n",
       "0.037949\n",
       "</td>\n",
       "<td>\n",
       "0.045737\n",
       "</td>\n",
       "<td>\n",
       "0.52556\n",
       "</td>\n",
       "<td>\n",
       "0.037172\n",
       "</td>\n",
       "<td>\n",
       "0.303819\n",
       "</td>\n",
       "<td>\n",
       "0.815909\n",
       "</td>\n",
       "<td>\n",
       "0.678298\n",
       "</td>\n",
       "<td>\n",
       "0.703495\n",
       "</td>\n",
       "<td>\n",
       "0.160242\n",
       "</td>\n",
       "<td>\n",
       "0.563789\n",
       "</td>\n",
       "<td>\n",
       "0.999017\n",
       "</td>\n",
       "<td>\n",
       "0.107396\n",
       "</td>\n",
       "<td>\n",
       "0.987818\n",
       "</td>\n",
       "<td>\n",
       "0.213269\n",
       "</td>\n",
       "<td>\n",
       "0.864438\n",
       "</td>\n",
       "<td>\n",
       "0.781261\n",
       "</td>\n",
       "<td>\n",
       "0.398976\n",
       "</td>\n",
       "<td>\n",
       "0.811049\n",
       "</td>\n",
       "<td>\n",
       "0.201187\n",
       "</td>\n",
       "<td>\n",
       "0.610532\n",
       "</td>\n",
       "<td>\n",
       "0.981617\n",
       "</td>\n",
       "<td>\n",
       "0.696182\n",
       "</td>\n",
       "<td>\n",
       "0.476824\n",
       "</td>\n",
       "<td>\n",
       "0.456393\n",
       "</td>\n",
       "<td>\n",
       "0.3071\n",
       "</td>\n",
       "<td>\n",
       "0.070704\n",
       "</td>\n",
       "<td>\n",
       "...\n",
       "</td>\n",
       "<td>\n",
       "0.212025\n",
       "</td>\n",
       "<td>\n",
       "0.718776\n",
       "</td>\n",
       "<td>\n",
       "0.863772\n",
       "</td>\n",
       "<td>\n",
       "0.836723\n",
       "</td>\n",
       "<td>\n",
       "0.272121\n",
       "</td>\n",
       "<td>\n",
       "0.800949\n",
       "</td>\n",
       "<td>\n",
       "0.734792\n",
       "</td>\n",
       "<td>\n",
       "0.506621\n",
       "</td>\n",
       "<td>\n",
       "0.321371\n",
       "</td>\n",
       "<td>\n",
       "0.087973\n",
       "</td>\n",
       "<td>\n",
       "0.867293\n",
       "</td>\n",
       "<td>\n",
       "0.627667\n",
       "</td>\n",
       "<td>\n",
       "0.889183\n",
       "</td>\n",
       "<td>\n",
       "0.998005\n",
       "</td>\n",
       "<td>\n",
       "0.422262\n",
       "</td>\n",
       "<td>\n",
       "0.412171\n",
       "</td>\n",
       "<td>\n",
       "0.784891\n",
       "</td>\n",
       "<td>\n",
       "0.464939\n",
       "</td>\n",
       "<td>\n",
       "0.591279\n",
       "</td>\n",
       "<td>\n",
       "0.634254\n",
       "</td>\n",
       "<td>\n",
       "0.340295\n",
       "</td>\n",
       "<td>\n",
       "0.884701\n",
       "</td>\n",
       "<td>\n",
       "0.795625\n",
       "</td>\n",
       "<td>\n",
       "0.239074\n",
       "</td>\n",
       "<td>\n",
       "0.04274\n",
       "</td>\n",
       "<td>\n",
       "0.072529\n",
       "</td>\n",
       "<td>\n",
       "0.548758\n",
       "</td>\n",
       "<td>\n",
       "0.967316\n",
       "</td>\n",
       "<td>\n",
       "0.576226\n",
       "</td>\n",
       "<td>\n",
       "0.671552\n",
       "</td>\n",
       "<td>\n",
       "0.382588\n",
       "</td>\n",
       "<td>\n",
       "0.209125\n",
       "</td>\n",
       "<td>\n",
       "0.873574\n",
       "</td>\n",
       "<td>\n",
       "0.289106\n",
       "</td>\n",
       "<td>\n",
       "0.868413\n",
       "</td>\n",
       "<td>\n",
       "0.225736\n",
       "</td>\n",
       "<td>\n",
       "0.269728\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "0.685521\n",
       "</td>\n",
       "<td>\n",
       "0.300789\n",
       "</td>\n",
       "<td>\n",
       "0.751959\n",
       "</td>\n",
       "<td>\n",
       "0.415466\n",
       "</td>\n",
       "<td>\n",
       "0.670178\n",
       "</td>\n",
       "<td>\n",
       "0.405571\n",
       "</td>\n",
       "<td>\n",
       "0.772665\n",
       "</td>\n",
       "<td>\n",
       "0.705782\n",
       "</td>\n",
       "<td>\n",
       "0.755357\n",
       "</td>\n",
       "<td>\n",
       "0.00082\n",
       "</td>\n",
       "<td>\n",
       "0.225622\n",
       "</td>\n",
       "<td>\n",
       "0.39374\n",
       "</td>\n",
       "<td>\n",
       "0.156345\n",
       "</td>\n",
       "<td>\n",
       "0.491989\n",
       "</td>\n",
       "<td>\n",
       "0.74189\n",
       "</td>\n",
       "<td>\n",
       "0.247517\n",
       "</td>\n",
       "<td>\n",
       "0.814866\n",
       "</td>\n",
       "<td>\n",
       "0.929771\n",
       "</td>\n",
       "<td>\n",
       "0.929555\n",
       "</td>\n",
       "<td>\n",
       "0.729604\n",
       "</td>\n",
       "<td>\n",
       "0.329593\n",
       "</td>\n",
       "<td>\n",
       "0.704661\n",
       "</td>\n",
       "<td>\n",
       "0.680124\n",
       "</td>\n",
       "<td>\n",
       "0.862563\n",
       "</td>\n",
       "<td>\n",
       "0.663751\n",
       "</td>\n",
       "<td>\n",
       "0.535962\n",
       "</td>\n",
       "<td>\n",
       "0.752143\n",
       "</td>\n",
       "<td>\n",
       "0.617749\n",
       "</td>\n",
       "<td>\n",
       "0.74543\n",
       "</td>\n",
       "<td>\n",
       "0.558282\n",
       "</td>\n",
       "<td>\n",
       "0.584999\n",
       "</td>\n",
       "<td>\n",
       "0.351613\n",
       "</td>\n",
       "<td>\n",
       "0.444335\n",
       "</td>\n",
       "<td>\n",
       "0.391234\n",
       "</td>\n",
       "<td>\n",
       "0.565424\n",
       "</td>\n",
       "<td>\n",
       "0.811048\n",
       "</td>\n",
       "<td>\n",
       "0.299882\n",
       "</td>\n",
       "<td>\n",
       "...\n",
       "</td>\n",
       "<td>\n",
       "0.832284\n",
       "</td>\n",
       "<td>\n",
       "0.09156\n",
       "</td>\n",
       "<td>\n",
       "0.844384\n",
       "</td>\n",
       "<td>\n",
       "0.997165\n",
       "</td>\n",
       "<td>\n",
       "0.111232\n",
       "</td>\n",
       "<td>\n",
       "0.217267\n",
       "</td>\n",
       "<td>\n",
       "0.411379\n",
       "</td>\n",
       "<td>\n",
       "0.217178\n",
       "</td>\n",
       "<td>\n",
       "0.076892\n",
       "</td>\n",
       "<td>\n",
       "0.042135\n",
       "</td>\n",
       "<td>\n",
       "0.763825\n",
       "</td>\n",
       "<td>\n",
       "0.239185\n",
       "</td>\n",
       "<td>\n",
       "0.413552\n",
       "</td>\n",
       "<td>\n",
       "0.466653\n",
       "</td>\n",
       "<td>\n",
       "0.86741\n",
       "</td>\n",
       "<td>\n",
       "0.332848\n",
       "</td>\n",
       "<td>\n",
       "0.773879\n",
       "</td>\n",
       "<td>\n",
       "0.749281\n",
       "</td>\n",
       "<td>\n",
       "0.466701\n",
       "</td>\n",
       "<td>\n",
       "0.631788\n",
       "</td>\n",
       "<td>\n",
       "0.223374\n",
       "</td>\n",
       "<td>\n",
       "0.98785\n",
       "</td>\n",
       "<td>\n",
       "0.972429\n",
       "</td>\n",
       "<td>\n",
       "0.51155\n",
       "</td>\n",
       "<td>\n",
       "0.908381\n",
       "</td>\n",
       "<td>\n",
       "0.717534\n",
       "</td>\n",
       "<td>\n",
       "0.967404\n",
       "</td>\n",
       "<td>\n",
       "0.978006\n",
       "</td>\n",
       "<td>\n",
       "0.052614\n",
       "</td>\n",
       "<td>\n",
       "0.52944\n",
       "</td>\n",
       "<td>\n",
       "0.267572\n",
       "</td>\n",
       "<td>\n",
       "0.396589\n",
       "</td>\n",
       "<td>\n",
       "0.195685\n",
       "</td>\n",
       "<td>\n",
       "0.323305\n",
       "</td>\n",
       "<td>\n",
       "0.160982\n",
       "</td>\n",
       "<td>\n",
       "0.977584\n",
       "</td>\n",
       "<td>\n",
       "0.781165\n",
       "</td>\n",
       "</tr>\n",
       "</tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "shape: (5, 100)\n",
       "┌──────────┬──────────┬──────────┬──────────┬─────┬──────────┬──────────┬──────────┬──────────┐\n",
       "│ 0        ┆ 1        ┆ 2        ┆ 3        ┆ ... ┆ 96       ┆ 97       ┆ 98       ┆ 99       │\n",
       "│ ---      ┆ ---      ┆ ---      ┆ ---      ┆     ┆ ---      ┆ ---      ┆ ---      ┆ ---      │\n",
       "│ f64      ┆ f64      ┆ f64      ┆ f64      ┆     ┆ f64      ┆ f64      ┆ f64      ┆ f64      │\n",
       "╞══════════╪══════════╪══════════╪══════════╪═════╪══════════╪══════════╪══════════╪══════════╡\n",
       "│ 0.739789 ┆ 0.171243 ┆ 0.77956  ┆ 0.453279 ┆ ... ┆ 0.485596 ┆ 0.196424 ┆ 0.558316 ┆ 0.036644 │\n",
       "│ 0.188237 ┆ 0.364673 ┆ 0.708197 ┆ 0.003689 ┆ ... ┆ 0.034112 ┆ 0.567413 ┆ 0.883934 ┆ 0.41937  │\n",
       "│ 0.387432 ┆ 0.542618 ┆ 0.385627 ┆ 0.165912 ┆ ... ┆ 0.744994 ┆ 0.662483 ┆ 0.150556 ┆ 0.776504 │\n",
       "│ 0.19037  ┆ 0.856863 ┆ 0.553109 ┆ 0.461054 ┆ ... ┆ 0.289106 ┆ 0.868413 ┆ 0.225736 ┆ 0.269728 │\n",
       "│ 0.685521 ┆ 0.300789 ┆ 0.751959 ┆ 0.415466 ┆ ... ┆ 0.323305 ┆ 0.160982 ┆ 0.977584 ┆ 0.781165 │\n",
       "└──────────┴──────────┴──────────┴──────────┴─────┴──────────┴──────────┴──────────┴──────────┘"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import polars as pl\n",
    "\n",
    "df_pl = pl.DataFrame(df_pa)\n",
    "df_pl.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "67b37588-7a54-454a-ab8b-8d32c61f8e27",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "14.9 ms ± 1.07 ms per loop (mean ± std. dev. of 30 runs, 1 loop each)\n"
     ]
    }
   ],
   "source": [
    "%timeit -r 30 -n 1 df_pl.mean()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2897ae55-9b46-4fff-a12c-919b004ffb77",
   "metadata": {},
   "source": [
    "### Pandas & NumPy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "b51e8a71-c30c-4612-be8f-225c76ddb0a2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "      <th>6</th>\n",
       "      <th>7</th>\n",
       "      <th>8</th>\n",
       "      <th>9</th>\n",
       "      <th>...</th>\n",
       "      <th>90</th>\n",
       "      <th>91</th>\n",
       "      <th>92</th>\n",
       "      <th>93</th>\n",
       "      <th>94</th>\n",
       "      <th>95</th>\n",
       "      <th>96</th>\n",
       "      <th>97</th>\n",
       "      <th>98</th>\n",
       "      <th>99</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.739789</td>\n",
       "      <td>0.171243</td>\n",
       "      <td>0.779560</td>\n",
       "      <td>0.453279</td>\n",
       "      <td>0.316272</td>\n",
       "      <td>0.202055</td>\n",
       "      <td>0.701529</td>\n",
       "      <td>0.223398</td>\n",
       "      <td>0.180779</td>\n",
       "      <td>0.361951</td>\n",
       "      <td>...</td>\n",
       "      <td>0.030731</td>\n",
       "      <td>0.012013</td>\n",
       "      <td>0.758276</td>\n",
       "      <td>0.347108</td>\n",
       "      <td>0.152085</td>\n",
       "      <td>0.914769</td>\n",
       "      <td>0.485596</td>\n",
       "      <td>0.196424</td>\n",
       "      <td>0.558316</td>\n",
       "      <td>0.036644</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.188237</td>\n",
       "      <td>0.364673</td>\n",
       "      <td>0.708197</td>\n",
       "      <td>0.003689</td>\n",
       "      <td>0.869673</td>\n",
       "      <td>0.993840</td>\n",
       "      <td>0.408806</td>\n",
       "      <td>0.738370</td>\n",
       "      <td>0.509626</td>\n",
       "      <td>0.516874</td>\n",
       "      <td>...</td>\n",
       "      <td>0.784797</td>\n",
       "      <td>0.437274</td>\n",
       "      <td>0.004180</td>\n",
       "      <td>0.281059</td>\n",
       "      <td>0.209215</td>\n",
       "      <td>0.581456</td>\n",
       "      <td>0.034112</td>\n",
       "      <td>0.567413</td>\n",
       "      <td>0.883934</td>\n",
       "      <td>0.419370</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.387432</td>\n",
       "      <td>0.542618</td>\n",
       "      <td>0.385627</td>\n",
       "      <td>0.165912</td>\n",
       "      <td>0.675967</td>\n",
       "      <td>0.496472</td>\n",
       "      <td>0.232236</td>\n",
       "      <td>0.759717</td>\n",
       "      <td>0.075509</td>\n",
       "      <td>0.060214</td>\n",
       "      <td>...</td>\n",
       "      <td>0.097261</td>\n",
       "      <td>0.680323</td>\n",
       "      <td>0.554496</td>\n",
       "      <td>0.107696</td>\n",
       "      <td>0.711632</td>\n",
       "      <td>0.346951</td>\n",
       "      <td>0.744994</td>\n",
       "      <td>0.662483</td>\n",
       "      <td>0.150556</td>\n",
       "      <td>0.776504</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.190370</td>\n",
       "      <td>0.856863</td>\n",
       "      <td>0.553109</td>\n",
       "      <td>0.461054</td>\n",
       "      <td>0.568778</td>\n",
       "      <td>0.187617</td>\n",
       "      <td>0.384497</td>\n",
       "      <td>0.648418</td>\n",
       "      <td>0.560689</td>\n",
       "      <td>0.211983</td>\n",
       "      <td>...</td>\n",
       "      <td>0.967316</td>\n",
       "      <td>0.576226</td>\n",
       "      <td>0.671552</td>\n",
       "      <td>0.382588</td>\n",
       "      <td>0.209125</td>\n",
       "      <td>0.873574</td>\n",
       "      <td>0.289106</td>\n",
       "      <td>0.868413</td>\n",
       "      <td>0.225736</td>\n",
       "      <td>0.269728</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.685521</td>\n",
       "      <td>0.300789</td>\n",
       "      <td>0.751959</td>\n",
       "      <td>0.415466</td>\n",
       "      <td>0.670178</td>\n",
       "      <td>0.405571</td>\n",
       "      <td>0.772665</td>\n",
       "      <td>0.705782</td>\n",
       "      <td>0.755357</td>\n",
       "      <td>0.000820</td>\n",
       "      <td>...</td>\n",
       "      <td>0.978006</td>\n",
       "      <td>0.052614</td>\n",
       "      <td>0.529440</td>\n",
       "      <td>0.267572</td>\n",
       "      <td>0.396589</td>\n",
       "      <td>0.195685</td>\n",
       "      <td>0.323305</td>\n",
       "      <td>0.160982</td>\n",
       "      <td>0.977584</td>\n",
       "      <td>0.781165</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 100 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "         0         1         2         3         4         5         6    \n",
       "0  0.739789  0.171243  0.779560  0.453279  0.316272  0.202055  0.701529  \\\n",
       "1  0.188237  0.364673  0.708197  0.003689  0.869673  0.993840  0.408806   \n",
       "2  0.387432  0.542618  0.385627  0.165912  0.675967  0.496472  0.232236   \n",
       "3  0.190370  0.856863  0.553109  0.461054  0.568778  0.187617  0.384497   \n",
       "4  0.685521  0.300789  0.751959  0.415466  0.670178  0.405571  0.772665   \n",
       "\n",
       "         7         8         9   ...        90        91        92        93   \n",
       "0  0.223398  0.180779  0.361951  ...  0.030731  0.012013  0.758276  0.347108  \\\n",
       "1  0.738370  0.509626  0.516874  ...  0.784797  0.437274  0.004180  0.281059   \n",
       "2  0.759717  0.075509  0.060214  ...  0.097261  0.680323  0.554496  0.107696   \n",
       "3  0.648418  0.560689  0.211983  ...  0.967316  0.576226  0.671552  0.382588   \n",
       "4  0.705782  0.755357  0.000820  ...  0.978006  0.052614  0.529440  0.267572   \n",
       "\n",
       "         94        95        96        97        98        99  \n",
       "0  0.152085  0.914769  0.485596  0.196424  0.558316  0.036644  \n",
       "1  0.209215  0.581456  0.034112  0.567413  0.883934  0.419370  \n",
       "2  0.711632  0.346951  0.744994  0.662483  0.150556  0.776504  \n",
       "3  0.209125  0.873574  0.289106  0.868413  0.225736  0.269728  \n",
       "4  0.396589  0.195685  0.323305  0.160982  0.977584  0.781165  \n",
       "\n",
       "[5 rows x 100 columns]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.DataFrame(numbers, dtype=\"float64\")\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "6f796d10-983c-400e-95d2-caa122601ae8",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "153 ms ± 3.71 ms per loop (mean ± std. dev. of 30 runs, 1 loop each)\n"
     ]
    }
   ],
   "source": [
    "%timeit -r 30 -n 1 df.mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "ee2ad294-270a-4b7d-919a-4fa6d0c709af",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "19.5 ms ± 462 µs per loop (mean ± std. dev. of 30 runs, 1 loop each)\n"
     ]
    }
   ],
   "source": [
    "%timeit -r 30 -n 1 numbers.mean()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9a4ded21-d5aa-4c40-9a4a-5906a9e20839",
   "metadata": {},
   "source": [
    "# 2) Int"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e3cf4b03-12f1-4175-8740-6a0bc7e88e9e",
   "metadata": {},
   "source": [
    "### PyArrow"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "8650b679-7b52-4d50-b409-eef04fe4c013",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "      <th>6</th>\n",
       "      <th>7</th>\n",
       "      <th>8</th>\n",
       "      <th>9</th>\n",
       "      <th>...</th>\n",
       "      <th>90</th>\n",
       "      <th>91</th>\n",
       "      <th>92</th>\n",
       "      <th>93</th>\n",
       "      <th>94</th>\n",
       "      <th>95</th>\n",
       "      <th>96</th>\n",
       "      <th>97</th>\n",
       "      <th>98</th>\n",
       "      <th>99</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>377</td>\n",
       "      <td>481</td>\n",
       "      <td>507</td>\n",
       "      <td>655</td>\n",
       "      <td>978</td>\n",
       "      <td>637</td>\n",
       "      <td>309</td>\n",
       "      <td>892</td>\n",
       "      <td>59</td>\n",
       "      <td>214</td>\n",
       "      <td>...</td>\n",
       "      <td>142</td>\n",
       "      <td>89</td>\n",
       "      <td>613</td>\n",
       "      <td>239</td>\n",
       "      <td>582</td>\n",
       "      <td>772</td>\n",
       "      <td>911</td>\n",
       "      <td>536</td>\n",
       "      <td>723</td>\n",
       "      <td>425</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>715</td>\n",
       "      <td>113</td>\n",
       "      <td>433</td>\n",
       "      <td>43</td>\n",
       "      <td>777</td>\n",
       "      <td>513</td>\n",
       "      <td>947</td>\n",
       "      <td>301</td>\n",
       "      <td>971</td>\n",
       "      <td>148</td>\n",
       "      <td>...</td>\n",
       "      <td>60</td>\n",
       "      <td>123</td>\n",
       "      <td>139</td>\n",
       "      <td>608</td>\n",
       "      <td>838</td>\n",
       "      <td>209</td>\n",
       "      <td>382</td>\n",
       "      <td>162</td>\n",
       "      <td>955</td>\n",
       "      <td>822</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>795</td>\n",
       "      <td>217</td>\n",
       "      <td>870</td>\n",
       "      <td>600</td>\n",
       "      <td>947</td>\n",
       "      <td>778</td>\n",
       "      <td>133</td>\n",
       "      <td>267</td>\n",
       "      <td>258</td>\n",
       "      <td>922</td>\n",
       "      <td>...</td>\n",
       "      <td>164</td>\n",
       "      <td>150</td>\n",
       "      <td>714</td>\n",
       "      <td>955</td>\n",
       "      <td>816</td>\n",
       "      <td>991</td>\n",
       "      <td>9</td>\n",
       "      <td>530</td>\n",
       "      <td>982</td>\n",
       "      <td>268</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>342</td>\n",
       "      <td>115</td>\n",
       "      <td>549</td>\n",
       "      <td>703</td>\n",
       "      <td>558</td>\n",
       "      <td>802</td>\n",
       "      <td>563</td>\n",
       "      <td>719</td>\n",
       "      <td>943</td>\n",
       "      <td>850</td>\n",
       "      <td>...</td>\n",
       "      <td>274</td>\n",
       "      <td>810</td>\n",
       "      <td>701</td>\n",
       "      <td>976</td>\n",
       "      <td>915</td>\n",
       "      <td>958</td>\n",
       "      <td>560</td>\n",
       "      <td>753</td>\n",
       "      <td>296</td>\n",
       "      <td>701</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>596</td>\n",
       "      <td>593</td>\n",
       "      <td>964</td>\n",
       "      <td>330</td>\n",
       "      <td>490</td>\n",
       "      <td>549</td>\n",
       "      <td>262</td>\n",
       "      <td>671</td>\n",
       "      <td>892</td>\n",
       "      <td>981</td>\n",
       "      <td>...</td>\n",
       "      <td>600</td>\n",
       "      <td>329</td>\n",
       "      <td>664</td>\n",
       "      <td>105</td>\n",
       "      <td>918</td>\n",
       "      <td>662</td>\n",
       "      <td>792</td>\n",
       "      <td>534</td>\n",
       "      <td>83</td>\n",
       "      <td>616</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 100 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    0    1    2    3    4    5    6    7    8    9   ...   90   91   92   93   \n",
       "0  377  481  507  655  978  637  309  892   59  214  ...  142   89  613  239  \\\n",
       "1  715  113  433   43  777  513  947  301  971  148  ...   60  123  139  608   \n",
       "2  795  217  870  600  947  778  133  267  258  922  ...  164  150  714  955   \n",
       "3  342  115  549  703  558  802  563  719  943  850  ...  274  810  701  976   \n",
       "4  596  593  964  330  490  549  262  671  892  981  ...  600  329  664  105   \n",
       "\n",
       "    94   95   96   97   98   99  \n",
       "0  582  772  911  536  723  425  \n",
       "1  838  209  382  162  955  822  \n",
       "2  816  991    9  530  982  268  \n",
       "3  915  958  560  753  296  701  \n",
       "4  918  662  792  534   83  616  \n",
       "\n",
       "[5 rows x 100 columns]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "numbers = np.random.randint(0, 1000, (1_000_000, 100))\n",
    "\n",
    "df_pa = pd.DataFrame(numbers, dtype=\"int64[pyarrow]\")\n",
    "df_pa.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "6db7a9d7-23f5-4d3d-aabf-f1482c384112",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "18.7 ms ± 2.77 ms per loop (mean ± std. dev. of 30 runs, 1 loop each)\n"
     ]
    }
   ],
   "source": [
    "%timeit -r 30 -n 1 df_pa.sum()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a4a0d7e9-afc3-4d92-b119-b9257fe670c8",
   "metadata": {},
   "source": [
    "### Polars"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "37803a25-f95c-4017-b40f-359fc69f8031",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       ".pl-dataframe > thead > tr > th {\n",
       "  text-align: right;\n",
       "}\n",
       "</style>\n",
       "\n",
       "<table border=\"1\" class=\"dataframe pl-dataframe\">\n",
       "<small>shape: (5, 100)</small>\n",
       "<thead>\n",
       "<tr>\n",
       "<th>\n",
       "0\n",
       "</th>\n",
       "<th>\n",
       "1\n",
       "</th>\n",
       "<th>\n",
       "2\n",
       "</th>\n",
       "<th>\n",
       "3\n",
       "</th>\n",
       "<th>\n",
       "4\n",
       "</th>\n",
       "<th>\n",
       "5\n",
       "</th>\n",
       "<th>\n",
       "6\n",
       "</th>\n",
       "<th>\n",
       "7\n",
       "</th>\n",
       "<th>\n",
       "8\n",
       "</th>\n",
       "<th>\n",
       "9\n",
       "</th>\n",
       "<th>\n",
       "10\n",
       "</th>\n",
       "<th>\n",
       "11\n",
       "</th>\n",
       "<th>\n",
       "12\n",
       "</th>\n",
       "<th>\n",
       "13\n",
       "</th>\n",
       "<th>\n",
       "14\n",
       "</th>\n",
       "<th>\n",
       "15\n",
       "</th>\n",
       "<th>\n",
       "16\n",
       "</th>\n",
       "<th>\n",
       "17\n",
       "</th>\n",
       "<th>\n",
       "18\n",
       "</th>\n",
       "<th>\n",
       "19\n",
       "</th>\n",
       "<th>\n",
       "20\n",
       "</th>\n",
       "<th>\n",
       "21\n",
       "</th>\n",
       "<th>\n",
       "22\n",
       "</th>\n",
       "<th>\n",
       "23\n",
       "</th>\n",
       "<th>\n",
       "24\n",
       "</th>\n",
       "<th>\n",
       "25\n",
       "</th>\n",
       "<th>\n",
       "26\n",
       "</th>\n",
       "<th>\n",
       "27\n",
       "</th>\n",
       "<th>\n",
       "28\n",
       "</th>\n",
       "<th>\n",
       "29\n",
       "</th>\n",
       "<th>\n",
       "30\n",
       "</th>\n",
       "<th>\n",
       "31\n",
       "</th>\n",
       "<th>\n",
       "32\n",
       "</th>\n",
       "<th>\n",
       "33\n",
       "</th>\n",
       "<th>\n",
       "34\n",
       "</th>\n",
       "<th>\n",
       "35\n",
       "</th>\n",
       "<th>\n",
       "36\n",
       "</th>\n",
       "<th>\n",
       "...\n",
       "</th>\n",
       "<th>\n",
       "63\n",
       "</th>\n",
       "<th>\n",
       "64\n",
       "</th>\n",
       "<th>\n",
       "65\n",
       "</th>\n",
       "<th>\n",
       "66\n",
       "</th>\n",
       "<th>\n",
       "67\n",
       "</th>\n",
       "<th>\n",
       "68\n",
       "</th>\n",
       "<th>\n",
       "69\n",
       "</th>\n",
       "<th>\n",
       "70\n",
       "</th>\n",
       "<th>\n",
       "71\n",
       "</th>\n",
       "<th>\n",
       "72\n",
       "</th>\n",
       "<th>\n",
       "73\n",
       "</th>\n",
       "<th>\n",
       "74\n",
       "</th>\n",
       "<th>\n",
       "75\n",
       "</th>\n",
       "<th>\n",
       "76\n",
       "</th>\n",
       "<th>\n",
       "77\n",
       "</th>\n",
       "<th>\n",
       "78\n",
       "</th>\n",
       "<th>\n",
       "79\n",
       "</th>\n",
       "<th>\n",
       "80\n",
       "</th>\n",
       "<th>\n",
       "81\n",
       "</th>\n",
       "<th>\n",
       "82\n",
       "</th>\n",
       "<th>\n",
       "83\n",
       "</th>\n",
       "<th>\n",
       "84\n",
       "</th>\n",
       "<th>\n",
       "85\n",
       "</th>\n",
       "<th>\n",
       "86\n",
       "</th>\n",
       "<th>\n",
       "87\n",
       "</th>\n",
       "<th>\n",
       "88\n",
       "</th>\n",
       "<th>\n",
       "89\n",
       "</th>\n",
       "<th>\n",
       "90\n",
       "</th>\n",
       "<th>\n",
       "91\n",
       "</th>\n",
       "<th>\n",
       "92\n",
       "</th>\n",
       "<th>\n",
       "93\n",
       "</th>\n",
       "<th>\n",
       "94\n",
       "</th>\n",
       "<th>\n",
       "95\n",
       "</th>\n",
       "<th>\n",
       "96\n",
       "</th>\n",
       "<th>\n",
       "97\n",
       "</th>\n",
       "<th>\n",
       "98\n",
       "</th>\n",
       "<th>\n",
       "99\n",
       "</th>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "...\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "</tr>\n",
       "</thead>\n",
       "<tbody>\n",
       "<tr>\n",
       "<td>\n",
       "377\n",
       "</td>\n",
       "<td>\n",
       "481\n",
       "</td>\n",
       "<td>\n",
       "507\n",
       "</td>\n",
       "<td>\n",
       "655\n",
       "</td>\n",
       "<td>\n",
       "978\n",
       "</td>\n",
       "<td>\n",
       "637\n",
       "</td>\n",
       "<td>\n",
       "309\n",
       "</td>\n",
       "<td>\n",
       "892\n",
       "</td>\n",
       "<td>\n",
       "59\n",
       "</td>\n",
       "<td>\n",
       "214\n",
       "</td>\n",
       "<td>\n",
       "674\n",
       "</td>\n",
       "<td>\n",
       "141\n",
       "</td>\n",
       "<td>\n",
       "905\n",
       "</td>\n",
       "<td>\n",
       "297\n",
       "</td>\n",
       "<td>\n",
       "581\n",
       "</td>\n",
       "<td>\n",
       "333\n",
       "</td>\n",
       "<td>\n",
       "9\n",
       "</td>\n",
       "<td>\n",
       "820\n",
       "</td>\n",
       "<td>\n",
       "793\n",
       "</td>\n",
       "<td>\n",
       "500\n",
       "</td>\n",
       "<td>\n",
       "380\n",
       "</td>\n",
       "<td>\n",
       "889\n",
       "</td>\n",
       "<td>\n",
       "200\n",
       "</td>\n",
       "<td>\n",
       "863\n",
       "</td>\n",
       "<td>\n",
       "968\n",
       "</td>\n",
       "<td>\n",
       "509\n",
       "</td>\n",
       "<td>\n",
       "889\n",
       "</td>\n",
       "<td>\n",
       "174\n",
       "</td>\n",
       "<td>\n",
       "488\n",
       "</td>\n",
       "<td>\n",
       "805\n",
       "</td>\n",
       "<td>\n",
       "577\n",
       "</td>\n",
       "<td>\n",
       "455\n",
       "</td>\n",
       "<td>\n",
       "514\n",
       "</td>\n",
       "<td>\n",
       "990\n",
       "</td>\n",
       "<td>\n",
       "962\n",
       "</td>\n",
       "<td>\n",
       "656\n",
       "</td>\n",
       "<td>\n",
       "300\n",
       "</td>\n",
       "<td>\n",
       "...\n",
       "</td>\n",
       "<td>\n",
       "765\n",
       "</td>\n",
       "<td>\n",
       "308\n",
       "</td>\n",
       "<td>\n",
       "998\n",
       "</td>\n",
       "<td>\n",
       "100\n",
       "</td>\n",
       "<td>\n",
       "89\n",
       "</td>\n",
       "<td>\n",
       "92\n",
       "</td>\n",
       "<td>\n",
       "551\n",
       "</td>\n",
       "<td>\n",
       "202\n",
       "</td>\n",
       "<td>\n",
       "578\n",
       "</td>\n",
       "<td>\n",
       "566\n",
       "</td>\n",
       "<td>\n",
       "619\n",
       "</td>\n",
       "<td>\n",
       "380\n",
       "</td>\n",
       "<td>\n",
       "389\n",
       "</td>\n",
       "<td>\n",
       "881\n",
       "</td>\n",
       "<td>\n",
       "466\n",
       "</td>\n",
       "<td>\n",
       "559\n",
       "</td>\n",
       "<td>\n",
       "702\n",
       "</td>\n",
       "<td>\n",
       "92\n",
       "</td>\n",
       "<td>\n",
       "631\n",
       "</td>\n",
       "<td>\n",
       "119\n",
       "</td>\n",
       "<td>\n",
       "783\n",
       "</td>\n",
       "<td>\n",
       "195\n",
       "</td>\n",
       "<td>\n",
       "98\n",
       "</td>\n",
       "<td>\n",
       "273\n",
       "</td>\n",
       "<td>\n",
       "8\n",
       "</td>\n",
       "<td>\n",
       "97\n",
       "</td>\n",
       "<td>\n",
       "253\n",
       "</td>\n",
       "<td>\n",
       "142\n",
       "</td>\n",
       "<td>\n",
       "89\n",
       "</td>\n",
       "<td>\n",
       "613\n",
       "</td>\n",
       "<td>\n",
       "239\n",
       "</td>\n",
       "<td>\n",
       "582\n",
       "</td>\n",
       "<td>\n",
       "772\n",
       "</td>\n",
       "<td>\n",
       "911\n",
       "</td>\n",
       "<td>\n",
       "536\n",
       "</td>\n",
       "<td>\n",
       "723\n",
       "</td>\n",
       "<td>\n",
       "425\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "715\n",
       "</td>\n",
       "<td>\n",
       "113\n",
       "</td>\n",
       "<td>\n",
       "433\n",
       "</td>\n",
       "<td>\n",
       "43\n",
       "</td>\n",
       "<td>\n",
       "777\n",
       "</td>\n",
       "<td>\n",
       "513\n",
       "</td>\n",
       "<td>\n",
       "947\n",
       "</td>\n",
       "<td>\n",
       "301\n",
       "</td>\n",
       "<td>\n",
       "971\n",
       "</td>\n",
       "<td>\n",
       "148\n",
       "</td>\n",
       "<td>\n",
       "953\n",
       "</td>\n",
       "<td>\n",
       "709\n",
       "</td>\n",
       "<td>\n",
       "769\n",
       "</td>\n",
       "<td>\n",
       "881\n",
       "</td>\n",
       "<td>\n",
       "115\n",
       "</td>\n",
       "<td>\n",
       "358\n",
       "</td>\n",
       "<td>\n",
       "758\n",
       "</td>\n",
       "<td>\n",
       "358\n",
       "</td>\n",
       "<td>\n",
       "216\n",
       "</td>\n",
       "<td>\n",
       "702\n",
       "</td>\n",
       "<td>\n",
       "831\n",
       "</td>\n",
       "<td>\n",
       "723\n",
       "</td>\n",
       "<td>\n",
       "236\n",
       "</td>\n",
       "<td>\n",
       "218\n",
       "</td>\n",
       "<td>\n",
       "688\n",
       "</td>\n",
       "<td>\n",
       "968\n",
       "</td>\n",
       "<td>\n",
       "89\n",
       "</td>\n",
       "<td>\n",
       "737\n",
       "</td>\n",
       "<td>\n",
       "407\n",
       "</td>\n",
       "<td>\n",
       "290\n",
       "</td>\n",
       "<td>\n",
       "967\n",
       "</td>\n",
       "<td>\n",
       "25\n",
       "</td>\n",
       "<td>\n",
       "786\n",
       "</td>\n",
       "<td>\n",
       "828\n",
       "</td>\n",
       "<td>\n",
       "609\n",
       "</td>\n",
       "<td>\n",
       "306\n",
       "</td>\n",
       "<td>\n",
       "841\n",
       "</td>\n",
       "<td>\n",
       "...\n",
       "</td>\n",
       "<td>\n",
       "682\n",
       "</td>\n",
       "<td>\n",
       "402\n",
       "</td>\n",
       "<td>\n",
       "544\n",
       "</td>\n",
       "<td>\n",
       "384\n",
       "</td>\n",
       "<td>\n",
       "34\n",
       "</td>\n",
       "<td>\n",
       "248\n",
       "</td>\n",
       "<td>\n",
       "130\n",
       "</td>\n",
       "<td>\n",
       "73\n",
       "</td>\n",
       "<td>\n",
       "66\n",
       "</td>\n",
       "<td>\n",
       "608\n",
       "</td>\n",
       "<td>\n",
       "398\n",
       "</td>\n",
       "<td>\n",
       "653\n",
       "</td>\n",
       "<td>\n",
       "302\n",
       "</td>\n",
       "<td>\n",
       "85\n",
       "</td>\n",
       "<td>\n",
       "609\n",
       "</td>\n",
       "<td>\n",
       "841\n",
       "</td>\n",
       "<td>\n",
       "174\n",
       "</td>\n",
       "<td>\n",
       "757\n",
       "</td>\n",
       "<td>\n",
       "868\n",
       "</td>\n",
       "<td>\n",
       "200\n",
       "</td>\n",
       "<td>\n",
       "853\n",
       "</td>\n",
       "<td>\n",
       "495\n",
       "</td>\n",
       "<td>\n",
       "237\n",
       "</td>\n",
       "<td>\n",
       "567\n",
       "</td>\n",
       "<td>\n",
       "30\n",
       "</td>\n",
       "<td>\n",
       "512\n",
       "</td>\n",
       "<td>\n",
       "418\n",
       "</td>\n",
       "<td>\n",
       "60\n",
       "</td>\n",
       "<td>\n",
       "123\n",
       "</td>\n",
       "<td>\n",
       "139\n",
       "</td>\n",
       "<td>\n",
       "608\n",
       "</td>\n",
       "<td>\n",
       "838\n",
       "</td>\n",
       "<td>\n",
       "209\n",
       "</td>\n",
       "<td>\n",
       "382\n",
       "</td>\n",
       "<td>\n",
       "162\n",
       "</td>\n",
       "<td>\n",
       "955\n",
       "</td>\n",
       "<td>\n",
       "822\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "795\n",
       "</td>\n",
       "<td>\n",
       "217\n",
       "</td>\n",
       "<td>\n",
       "870\n",
       "</td>\n",
       "<td>\n",
       "600\n",
       "</td>\n",
       "<td>\n",
       "947\n",
       "</td>\n",
       "<td>\n",
       "778\n",
       "</td>\n",
       "<td>\n",
       "133\n",
       "</td>\n",
       "<td>\n",
       "267\n",
       "</td>\n",
       "<td>\n",
       "258\n",
       "</td>\n",
       "<td>\n",
       "922\n",
       "</td>\n",
       "<td>\n",
       "579\n",
       "</td>\n",
       "<td>\n",
       "674\n",
       "</td>\n",
       "<td>\n",
       "706\n",
       "</td>\n",
       "<td>\n",
       "337\n",
       "</td>\n",
       "<td>\n",
       "870\n",
       "</td>\n",
       "<td>\n",
       "755\n",
       "</td>\n",
       "<td>\n",
       "57\n",
       "</td>\n",
       "<td>\n",
       "212\n",
       "</td>\n",
       "<td>\n",
       "208\n",
       "</td>\n",
       "<td>\n",
       "727\n",
       "</td>\n",
       "<td>\n",
       "721\n",
       "</td>\n",
       "<td>\n",
       "804\n",
       "</td>\n",
       "<td>\n",
       "539\n",
       "</td>\n",
       "<td>\n",
       "795\n",
       "</td>\n",
       "<td>\n",
       "94\n",
       "</td>\n",
       "<td>\n",
       "766\n",
       "</td>\n",
       "<td>\n",
       "72\n",
       "</td>\n",
       "<td>\n",
       "354\n",
       "</td>\n",
       "<td>\n",
       "845\n",
       "</td>\n",
       "<td>\n",
       "44\n",
       "</td>\n",
       "<td>\n",
       "404\n",
       "</td>\n",
       "<td>\n",
       "751\n",
       "</td>\n",
       "<td>\n",
       "320\n",
       "</td>\n",
       "<td>\n",
       "371\n",
       "</td>\n",
       "<td>\n",
       "979\n",
       "</td>\n",
       "<td>\n",
       "772\n",
       "</td>\n",
       "<td>\n",
       "132\n",
       "</td>\n",
       "<td>\n",
       "...\n",
       "</td>\n",
       "<td>\n",
       "462\n",
       "</td>\n",
       "<td>\n",
       "705\n",
       "</td>\n",
       "<td>\n",
       "893\n",
       "</td>\n",
       "<td>\n",
       "773\n",
       "</td>\n",
       "<td>\n",
       "657\n",
       "</td>\n",
       "<td>\n",
       "980\n",
       "</td>\n",
       "<td>\n",
       "614\n",
       "</td>\n",
       "<td>\n",
       "535\n",
       "</td>\n",
       "<td>\n",
       "691\n",
       "</td>\n",
       "<td>\n",
       "352\n",
       "</td>\n",
       "<td>\n",
       "453\n",
       "</td>\n",
       "<td>\n",
       "286\n",
       "</td>\n",
       "<td>\n",
       "330\n",
       "</td>\n",
       "<td>\n",
       "475\n",
       "</td>\n",
       "<td>\n",
       "161\n",
       "</td>\n",
       "<td>\n",
       "757\n",
       "</td>\n",
       "<td>\n",
       "431\n",
       "</td>\n",
       "<td>\n",
       "662\n",
       "</td>\n",
       "<td>\n",
       "794\n",
       "</td>\n",
       "<td>\n",
       "725\n",
       "</td>\n",
       "<td>\n",
       "459\n",
       "</td>\n",
       "<td>\n",
       "967\n",
       "</td>\n",
       "<td>\n",
       "698\n",
       "</td>\n",
       "<td>\n",
       "1\n",
       "</td>\n",
       "<td>\n",
       "788\n",
       "</td>\n",
       "<td>\n",
       "208\n",
       "</td>\n",
       "<td>\n",
       "1\n",
       "</td>\n",
       "<td>\n",
       "164\n",
       "</td>\n",
       "<td>\n",
       "150\n",
       "</td>\n",
       "<td>\n",
       "714\n",
       "</td>\n",
       "<td>\n",
       "955\n",
       "</td>\n",
       "<td>\n",
       "816\n",
       "</td>\n",
       "<td>\n",
       "991\n",
       "</td>\n",
       "<td>\n",
       "9\n",
       "</td>\n",
       "<td>\n",
       "530\n",
       "</td>\n",
       "<td>\n",
       "982\n",
       "</td>\n",
       "<td>\n",
       "268\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "342\n",
       "</td>\n",
       "<td>\n",
       "115\n",
       "</td>\n",
       "<td>\n",
       "549\n",
       "</td>\n",
       "<td>\n",
       "703\n",
       "</td>\n",
       "<td>\n",
       "558\n",
       "</td>\n",
       "<td>\n",
       "802\n",
       "</td>\n",
       "<td>\n",
       "563\n",
       "</td>\n",
       "<td>\n",
       "719\n",
       "</td>\n",
       "<td>\n",
       "943\n",
       "</td>\n",
       "<td>\n",
       "850\n",
       "</td>\n",
       "<td>\n",
       "5\n",
       "</td>\n",
       "<td>\n",
       "711\n",
       "</td>\n",
       "<td>\n",
       "433\n",
       "</td>\n",
       "<td>\n",
       "267\n",
       "</td>\n",
       "<td>\n",
       "920\n",
       "</td>\n",
       "<td>\n",
       "432\n",
       "</td>\n",
       "<td>\n",
       "4\n",
       "</td>\n",
       "<td>\n",
       "853\n",
       "</td>\n",
       "<td>\n",
       "613\n",
       "</td>\n",
       "<td>\n",
       "892\n",
       "</td>\n",
       "<td>\n",
       "220\n",
       "</td>\n",
       "<td>\n",
       "937\n",
       "</td>\n",
       "<td>\n",
       "232\n",
       "</td>\n",
       "<td>\n",
       "292\n",
       "</td>\n",
       "<td>\n",
       "676\n",
       "</td>\n",
       "<td>\n",
       "69\n",
       "</td>\n",
       "<td>\n",
       "266\n",
       "</td>\n",
       "<td>\n",
       "289\n",
       "</td>\n",
       "<td>\n",
       "415\n",
       "</td>\n",
       "<td>\n",
       "494\n",
       "</td>\n",
       "<td>\n",
       "232\n",
       "</td>\n",
       "<td>\n",
       "260\n",
       "</td>\n",
       "<td>\n",
       "149\n",
       "</td>\n",
       "<td>\n",
       "231\n",
       "</td>\n",
       "<td>\n",
       "620\n",
       "</td>\n",
       "<td>\n",
       "808\n",
       "</td>\n",
       "<td>\n",
       "759\n",
       "</td>\n",
       "<td>\n",
       "...\n",
       "</td>\n",
       "<td>\n",
       "313\n",
       "</td>\n",
       "<td>\n",
       "522\n",
       "</td>\n",
       "<td>\n",
       "250\n",
       "</td>\n",
       "<td>\n",
       "304\n",
       "</td>\n",
       "<td>\n",
       "258\n",
       "</td>\n",
       "<td>\n",
       "245\n",
       "</td>\n",
       "<td>\n",
       "337\n",
       "</td>\n",
       "<td>\n",
       "779\n",
       "</td>\n",
       "<td>\n",
       "506\n",
       "</td>\n",
       "<td>\n",
       "743\n",
       "</td>\n",
       "<td>\n",
       "19\n",
       "</td>\n",
       "<td>\n",
       "538\n",
       "</td>\n",
       "<td>\n",
       "881\n",
       "</td>\n",
       "<td>\n",
       "830\n",
       "</td>\n",
       "<td>\n",
       "296\n",
       "</td>\n",
       "<td>\n",
       "174\n",
       "</td>\n",
       "<td>\n",
       "798\n",
       "</td>\n",
       "<td>\n",
       "919\n",
       "</td>\n",
       "<td>\n",
       "163\n",
       "</td>\n",
       "<td>\n",
       "576\n",
       "</td>\n",
       "<td>\n",
       "630\n",
       "</td>\n",
       "<td>\n",
       "502\n",
       "</td>\n",
       "<td>\n",
       "444\n",
       "</td>\n",
       "<td>\n",
       "931\n",
       "</td>\n",
       "<td>\n",
       "986\n",
       "</td>\n",
       "<td>\n",
       "346\n",
       "</td>\n",
       "<td>\n",
       "174\n",
       "</td>\n",
       "<td>\n",
       "274\n",
       "</td>\n",
       "<td>\n",
       "810\n",
       "</td>\n",
       "<td>\n",
       "701\n",
       "</td>\n",
       "<td>\n",
       "976\n",
       "</td>\n",
       "<td>\n",
       "915\n",
       "</td>\n",
       "<td>\n",
       "958\n",
       "</td>\n",
       "<td>\n",
       "560\n",
       "</td>\n",
       "<td>\n",
       "753\n",
       "</td>\n",
       "<td>\n",
       "296\n",
       "</td>\n",
       "<td>\n",
       "701\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "596\n",
       "</td>\n",
       "<td>\n",
       "593\n",
       "</td>\n",
       "<td>\n",
       "964\n",
       "</td>\n",
       "<td>\n",
       "330\n",
       "</td>\n",
       "<td>\n",
       "490\n",
       "</td>\n",
       "<td>\n",
       "549\n",
       "</td>\n",
       "<td>\n",
       "262\n",
       "</td>\n",
       "<td>\n",
       "671\n",
       "</td>\n",
       "<td>\n",
       "892\n",
       "</td>\n",
       "<td>\n",
       "981\n",
       "</td>\n",
       "<td>\n",
       "267\n",
       "</td>\n",
       "<td>\n",
       "184\n",
       "</td>\n",
       "<td>\n",
       "270\n",
       "</td>\n",
       "<td>\n",
       "18\n",
       "</td>\n",
       "<td>\n",
       "700\n",
       "</td>\n",
       "<td>\n",
       "400\n",
       "</td>\n",
       "<td>\n",
       "794\n",
       "</td>\n",
       "<td>\n",
       "566\n",
       "</td>\n",
       "<td>\n",
       "826\n",
       "</td>\n",
       "<td>\n",
       "445\n",
       "</td>\n",
       "<td>\n",
       "496\n",
       "</td>\n",
       "<td>\n",
       "405\n",
       "</td>\n",
       "<td>\n",
       "607\n",
       "</td>\n",
       "<td>\n",
       "471\n",
       "</td>\n",
       "<td>\n",
       "252\n",
       "</td>\n",
       "<td>\n",
       "417\n",
       "</td>\n",
       "<td>\n",
       "867\n",
       "</td>\n",
       "<td>\n",
       "823\n",
       "</td>\n",
       "<td>\n",
       "9\n",
       "</td>\n",
       "<td>\n",
       "982\n",
       "</td>\n",
       "<td>\n",
       "912\n",
       "</td>\n",
       "<td>\n",
       "673\n",
       "</td>\n",
       "<td>\n",
       "428\n",
       "</td>\n",
       "<td>\n",
       "691\n",
       "</td>\n",
       "<td>\n",
       "436\n",
       "</td>\n",
       "<td>\n",
       "815\n",
       "</td>\n",
       "<td>\n",
       "335\n",
       "</td>\n",
       "<td>\n",
       "...\n",
       "</td>\n",
       "<td>\n",
       "919\n",
       "</td>\n",
       "<td>\n",
       "401\n",
       "</td>\n",
       "<td>\n",
       "711\n",
       "</td>\n",
       "<td>\n",
       "784\n",
       "</td>\n",
       "<td>\n",
       "346\n",
       "</td>\n",
       "<td>\n",
       "971\n",
       "</td>\n",
       "<td>\n",
       "111\n",
       "</td>\n",
       "<td>\n",
       "967\n",
       "</td>\n",
       "<td>\n",
       "788\n",
       "</td>\n",
       "<td>\n",
       "60\n",
       "</td>\n",
       "<td>\n",
       "735\n",
       "</td>\n",
       "<td>\n",
       "825\n",
       "</td>\n",
       "<td>\n",
       "312\n",
       "</td>\n",
       "<td>\n",
       "979\n",
       "</td>\n",
       "<td>\n",
       "702\n",
       "</td>\n",
       "<td>\n",
       "148\n",
       "</td>\n",
       "<td>\n",
       "139\n",
       "</td>\n",
       "<td>\n",
       "615\n",
       "</td>\n",
       "<td>\n",
       "431\n",
       "</td>\n",
       "<td>\n",
       "195\n",
       "</td>\n",
       "<td>\n",
       "706\n",
       "</td>\n",
       "<td>\n",
       "869\n",
       "</td>\n",
       "<td>\n",
       "875\n",
       "</td>\n",
       "<td>\n",
       "479\n",
       "</td>\n",
       "<td>\n",
       "346\n",
       "</td>\n",
       "<td>\n",
       "206\n",
       "</td>\n",
       "<td>\n",
       "423\n",
       "</td>\n",
       "<td>\n",
       "600\n",
       "</td>\n",
       "<td>\n",
       "329\n",
       "</td>\n",
       "<td>\n",
       "664\n",
       "</td>\n",
       "<td>\n",
       "105\n",
       "</td>\n",
       "<td>\n",
       "918\n",
       "</td>\n",
       "<td>\n",
       "662\n",
       "</td>\n",
       "<td>\n",
       "792\n",
       "</td>\n",
       "<td>\n",
       "534\n",
       "</td>\n",
       "<td>\n",
       "83\n",
       "</td>\n",
       "<td>\n",
       "616\n",
       "</td>\n",
       "</tr>\n",
       "</tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "shape: (5, 100)\n",
       "┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐\n",
       "│ 0   ┆ 1   ┆ 2   ┆ 3   ┆ ... ┆ 96  ┆ 97  ┆ 98  ┆ 99  │\n",
       "│ --- ┆ --- ┆ --- ┆ --- ┆     ┆ --- ┆ --- ┆ --- ┆ --- │\n",
       "│ i64 ┆ i64 ┆ i64 ┆ i64 ┆     ┆ i64 ┆ i64 ┆ i64 ┆ i64 │\n",
       "╞═════╪═════╪═════╪═════╪═════╪═════╪═════╪═════╪═════╡\n",
       "│ 377 ┆ 481 ┆ 507 ┆ 655 ┆ ... ┆ 911 ┆ 536 ┆ 723 ┆ 425 │\n",
       "│ 715 ┆ 113 ┆ 433 ┆ 43  ┆ ... ┆ 382 ┆ 162 ┆ 955 ┆ 822 │\n",
       "│ 795 ┆ 217 ┆ 870 ┆ 600 ┆ ... ┆ 9   ┆ 530 ┆ 982 ┆ 268 │\n",
       "│ 342 ┆ 115 ┆ 549 ┆ 703 ┆ ... ┆ 560 ┆ 753 ┆ 296 ┆ 701 │\n",
       "│ 596 ┆ 593 ┆ 964 ┆ 330 ┆ ... ┆ 792 ┆ 534 ┆ 83  ┆ 616 │\n",
       "└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_pl = pl.DataFrame(df_pa)\n",
    "df_pl.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "27393845-09be-4f7c-8b62-fbe1dd0a9053",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "14.5 ms ± 694 µs per loop (mean ± std. dev. of 30 runs, 1 loop each)\n"
     ]
    }
   ],
   "source": [
    "%timeit -r 30 -n 1 df_pl.sum()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "feb1db35-aada-4006-aaf6-f8cc4a1ddf79",
   "metadata": {},
   "source": [
    "### Pandas & NumPy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "a3db23e0-db57-4a46-a425-79cf9e17c682",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "      <th>6</th>\n",
       "      <th>7</th>\n",
       "      <th>8</th>\n",
       "      <th>9</th>\n",
       "      <th>...</th>\n",
       "      <th>90</th>\n",
       "      <th>91</th>\n",
       "      <th>92</th>\n",
       "      <th>93</th>\n",
       "      <th>94</th>\n",
       "      <th>95</th>\n",
       "      <th>96</th>\n",
       "      <th>97</th>\n",
       "      <th>98</th>\n",
       "      <th>99</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>377</td>\n",
       "      <td>481</td>\n",
       "      <td>507</td>\n",
       "      <td>655</td>\n",
       "      <td>978</td>\n",
       "      <td>637</td>\n",
       "      <td>309</td>\n",
       "      <td>892</td>\n",
       "      <td>59</td>\n",
       "      <td>214</td>\n",
       "      <td>...</td>\n",
       "      <td>142</td>\n",
       "      <td>89</td>\n",
       "      <td>613</td>\n",
       "      <td>239</td>\n",
       "      <td>582</td>\n",
       "      <td>772</td>\n",
       "      <td>911</td>\n",
       "      <td>536</td>\n",
       "      <td>723</td>\n",
       "      <td>425</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>715</td>\n",
       "      <td>113</td>\n",
       "      <td>433</td>\n",
       "      <td>43</td>\n",
       "      <td>777</td>\n",
       "      <td>513</td>\n",
       "      <td>947</td>\n",
       "      <td>301</td>\n",
       "      <td>971</td>\n",
       "      <td>148</td>\n",
       "      <td>...</td>\n",
       "      <td>60</td>\n",
       "      <td>123</td>\n",
       "      <td>139</td>\n",
       "      <td>608</td>\n",
       "      <td>838</td>\n",
       "      <td>209</td>\n",
       "      <td>382</td>\n",
       "      <td>162</td>\n",
       "      <td>955</td>\n",
       "      <td>822</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>795</td>\n",
       "      <td>217</td>\n",
       "      <td>870</td>\n",
       "      <td>600</td>\n",
       "      <td>947</td>\n",
       "      <td>778</td>\n",
       "      <td>133</td>\n",
       "      <td>267</td>\n",
       "      <td>258</td>\n",
       "      <td>922</td>\n",
       "      <td>...</td>\n",
       "      <td>164</td>\n",
       "      <td>150</td>\n",
       "      <td>714</td>\n",
       "      <td>955</td>\n",
       "      <td>816</td>\n",
       "      <td>991</td>\n",
       "      <td>9</td>\n",
       "      <td>530</td>\n",
       "      <td>982</td>\n",
       "      <td>268</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>342</td>\n",
       "      <td>115</td>\n",
       "      <td>549</td>\n",
       "      <td>703</td>\n",
       "      <td>558</td>\n",
       "      <td>802</td>\n",
       "      <td>563</td>\n",
       "      <td>719</td>\n",
       "      <td>943</td>\n",
       "      <td>850</td>\n",
       "      <td>...</td>\n",
       "      <td>274</td>\n",
       "      <td>810</td>\n",
       "      <td>701</td>\n",
       "      <td>976</td>\n",
       "      <td>915</td>\n",
       "      <td>958</td>\n",
       "      <td>560</td>\n",
       "      <td>753</td>\n",
       "      <td>296</td>\n",
       "      <td>701</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>596</td>\n",
       "      <td>593</td>\n",
       "      <td>964</td>\n",
       "      <td>330</td>\n",
       "      <td>490</td>\n",
       "      <td>549</td>\n",
       "      <td>262</td>\n",
       "      <td>671</td>\n",
       "      <td>892</td>\n",
       "      <td>981</td>\n",
       "      <td>...</td>\n",
       "      <td>600</td>\n",
       "      <td>329</td>\n",
       "      <td>664</td>\n",
       "      <td>105</td>\n",
       "      <td>918</td>\n",
       "      <td>662</td>\n",
       "      <td>792</td>\n",
       "      <td>534</td>\n",
       "      <td>83</td>\n",
       "      <td>616</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 100 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    0    1    2    3    4    5    6    7    8    9   ...   90   91   92   93   \n",
       "0  377  481  507  655  978  637  309  892   59  214  ...  142   89  613  239  \\\n",
       "1  715  113  433   43  777  513  947  301  971  148  ...   60  123  139  608   \n",
       "2  795  217  870  600  947  778  133  267  258  922  ...  164  150  714  955   \n",
       "3  342  115  549  703  558  802  563  719  943  850  ...  274  810  701  976   \n",
       "4  596  593  964  330  490  549  262  671  892  981  ...  600  329  664  105   \n",
       "\n",
       "    94   95   96   97   98   99  \n",
       "0  582  772  911  536  723  425  \n",
       "1  838  209  382  162  955  822  \n",
       "2  816  991    9  530  982  268  \n",
       "3  915  958  560  753  296  701  \n",
       "4  918  662  792  534   83  616  \n",
       "\n",
       "[5 rows x 100 columns]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.DataFrame(numbers, dtype=\"int64\")\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "94678774-71fc-494a-832b-c80242a57c89",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "46.6 ms ± 195 µs per loop (mean ± std. dev. of 30 runs, 1 loop each)\n"
     ]
    }
   ],
   "source": [
    "%timeit -r 30 -n 1 df.sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "852c0978-56d5-4f5d-9f03-b11718346872",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "17.6 ms ± 687 µs per loop (mean ± std. dev. of 30 runs, 1 loop each)\n"
     ]
    }
   ],
   "source": [
    "%timeit -r 30 -n 1 numbers.sum()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "bf934bb8-a3b4-4dc8-bd3a-9d5dc577f73b",
   "metadata": {},
   "source": [
    "# 3) Str"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "44154a34-7b2d-411f-85d8-f1ba8b0d5312",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['v', 'c', 'a', ..., 'g', 'n', 'g'], dtype='<U1')"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import string\n",
    "\n",
    "ALPHABET = np.array(list(string.ascii_lowercase + ' '))\n",
    "\n",
    "\n",
    "def generate_guess(sentence):\n",
    "    return np.random.choice(ALPHABET, size=len(sentence))\n",
    "\n",
    "\n",
    "s = generate_guess(\"Why don't scientists trust atoms? Because they make up everything!\" * 10_000)\n",
    "s"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0ee82c28-5e53-465f-a8cb-eb7f5ac78aa0",
   "metadata": {},
   "source": [
    "### Pandas & NumPy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "dd9b074e-aa98-4ec7-b754-45be3ff214eb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>v</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>c</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>a</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>t</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>a</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   0\n",
       "0  v\n",
       "1  c\n",
       "2  a\n",
       "3  t\n",
       "4  a"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.DataFrame(s, dtype=\"string\")\n",
    "\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "3087cf58-79d0-4e35-b240-bab0a5e54b58",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0         0\n",
       "1         0\n",
       "2         1\n",
       "3         0\n",
       "4         1\n",
       "         ..\n",
       "659995    0\n",
       "659996    0\n",
       "659997    0\n",
       "659998    0\n",
       "659999    0\n",
       "Name: 0, Length: 660000, dtype: Int64"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[0].str.count(\"a\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "f7ed2fd6-616a-492b-a6b7-e5b6b3954cd5",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "64.7 ms ± 654 µs per loop (mean ± std. dev. of 30 runs, 1 loop each)\n"
     ]
    }
   ],
   "source": [
    "%timeit -r 30 -n 1 df[0].str.replace(\"a\", \"b\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "2dd32838-f685-4877-81c7-c80195de4a44",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "279 ms ± 1.43 ms per loop (mean ± std. dev. of 30 runs, 1 loop each)\n"
     ]
    }
   ],
   "source": [
    "%timeit -r 30 -n 1 np.char.replace(s, \"a\", \"b\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5c4e4ac9-db7c-4511-8040-f84c99a140e3",
   "metadata": {},
   "source": [
    "### PyArrow"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "954a5e02-4e28-4451-b223-4d3f4b6bb6ad",
   "metadata": {},
   "outputs": [],
   "source": [
    "df_pa = pd.DataFrame(s, dtype=\"string[pyarrow]\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "2b13a6df-530a-4f30-b41c-0621aba07cb7",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "5.45 ms ± 183 µs per loop (mean ± std. dev. of 30 runs, 1 loop each)\n"
     ]
    }
   ],
   "source": [
    "%timeit -r 30 -n 1 df_pa[0].str.replace(\"a\", \"b\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ddc529a9-48df-464b-9d19-d576e8049dcf",
   "metadata": {},
   "source": [
    "### Polars"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "932d810b-083b-4796-bf82-d73ee4a6921b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       ".pl-dataframe > thead > tr > th {\n",
       "  text-align: right;\n",
       "}\n",
       "</style>\n",
       "\n",
       "<table border=\"1\" class=\"dataframe pl-dataframe\">\n",
       "<small>shape: (5, 1)</small>\n",
       "<thead>\n",
       "<tr>\n",
       "<th>\n",
       "0\n",
       "</th>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "str\n",
       "</td>\n",
       "</tr>\n",
       "</thead>\n",
       "<tbody>\n",
       "<tr>\n",
       "<td>\n",
       "&quot;v&quot;\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "&quot;c&quot;\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "&quot;a&quot;\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "&quot;t&quot;\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "&quot;a&quot;\n",
       "</td>\n",
       "</tr>\n",
       "</tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "shape: (5, 1)\n",
       "┌─────┐\n",
       "│ 0   │\n",
       "│ --- │\n",
       "│ str │\n",
       "╞═════╡\n",
       "│ v   │\n",
       "│ c   │\n",
       "│ a   │\n",
       "│ t   │\n",
       "│ a   │\n",
       "└─────┘"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_pl = pl.DataFrame(df_pa)\n",
    "df_pl.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "a7e2d4a6-60f5-4dc8-9c59-688d603ba7c4",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "11.6 ms ± 177 µs per loop (mean ± std. dev. of 30 runs, 1 loop each)\n"
     ]
    }
   ],
   "source": [
    "%timeit -r 30 -n 1 df_pl[\"0\"].str.replace(\"a\", \"b\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d4b7a0de-411c-4064-9f91-bcaa45076a07",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.16"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
